﻿/**
 * IMonAIR: A new open-source library for instant messenger connectivity. <http://code.google.com/p/imonair/>
 *
 * This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
 */
/**
 * @author Andre de Groot <http://www.cmd.tech.nhl.nl/users/groot406/weblog/>
 * @author Piotr Zema <http://felixz.mark-naegeli.com>
 */
package net.imonair.msn.chats {
	import flash.text.TextFormat;
//	import net.imonair.core.connectors.IIMConnector;
	import net.imonair.core.contacts.IIMContact;
	import net.imonair.core.chats.IIMMessage;
//	import net.imonair.msn.chats.MSNSwitchBoard;
	public class MSNMessage implements IIMMessage {
		private var _sender:IIMContact;//, _receiver:IIMContact
//		private var _switchBoard:MSNSwitchBoard;
		private var _textFormat:TextFormat;
		private var _message:String;
		private var _date:Date;
//		private var additionalProperties:Array = new Array();
		/**
		 * Constructor
		 * @param message A message to be sent.
		 * @param textFormat A textFormat of the message.
		 */
		public function MSNMessage(message:String, textFormat:TextFormat = null) {
			this._date = new Date();
			this._textFormat = textFormat || new TextFormat();
			this._message = message;
		}
		/**
		 * Provides the associated message string.
		 */
		public function get message():String {
			return this._message;
		}
		/**
		 * Provides the associated textFormat instance.
		 */
		public function get textFormat():TextFormat {
			return this._textFormat;
		}
		/**
		 * Provides the date when that messege was received.
		 */
		public function get dateReceived():Date {
			return this._date;
		}
/*		public function get receiver():IIMContact {
			return this._receiver;
		}
		public function set receiver(value:IIMContact):void {
			this._receiver = value;
		}
*/		/**
		 * Determines the sender of the message.
		 */
		public function get sender():IIMContact {
			return this._sender;
		}
		public function set sender(value:IIMContact):void {
			this._sender = value;
		}
/*		public function get switchBoard():MSNSwitchBoard {
			return this._switchBoard;
		}
		public function set switchBoard(value:MSNSwitchBoard):void {
			this._switchBoard = value;
		}
		//Should be deprecated?
		public function setProperty(property:String, value:*):void {
			trace("MSNMessage.setProperty(" + property + ", " + value + ")");
			this.additionalProperties[property] = value;
		}
		public function getProperty(value:String):* {
			trace("MSNMessage.getProperty(" + value + ")");
			return this.additionalProperties[value];
		}
		public function hasProperty(value:String):Boolean {
			trace("MSNMessage.hasProperty(" + value + ")");
			return this.additionalProperties[value]?true:false;
		}
*/	}
}